package com.jy.modules.cims.common.open.api.enums;

public enum EntryResponseEnum {
	
	SUCESS21001("21001",  "成功访问接口"), 
	PROCESS31001("31001", "验签通过"), 
	FAILURE41001("41001", "签名验证不通过"), 
	FAILURE41002("41002", "访问接口失败"), 
	FAILURE41003("41003", "校验不通过"), 
	FAILURE41004("41004", "商户不存在"), 
	FAILURE41005("41005", "没有对应接口"), 
	FAILURE41006("41006", "协议版本不支持"), 
	FAILURE41007("41007", "请求已过期"), 
	FAILURE41008("41008", "不支持的签名加密"), 
	FAILURE41009("41009", "没有收到参数");

	private String code;
	private String message;

	private EntryResponseEnum(String code, String message) {
		this.code = code;
		this.message = message;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return this.message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public static boolean isVerificated(String code) {
		if (code == null) {
			return false;
		}
		return PROCESS31001.getCode().equals(code);
	}

	public static boolean isSuccess(String code) {
		if (code == null) {
			return false;
		}
		return SUCESS21001.getCode().equals(code);
	}
}
